#ifndef MY_CHANNEL_H
#define MY_CHANNEL_H 1


#define MSGD_CMD_OPEN_CHANNEL   1
#define MSGD_CMD_CLOSE_CHANNEL  2
#define MSGD_CMD_QUIT           3
#define MSGD_CMD_TERMINATE      4
#define MSGD_CMD_REOPEN         5

typedef struct {
  msgd_uint_t command;
  msgd_int_t  slot;
  pid_t       pid;
  int         fd;
} msgd_channel_t;




msgd_int_t msgd_write_channel(int fd , msgd_channel_t *channel, size_t size);
msgd_int_t msgd_read_channel(int  fd , msgd_channel_t *channel, size_t size);
//msgd_int_t msgd_add_channel_event(int fd, msgd_int_t, event , msgd_event_handler_pt handler);
void       msgd_close_channel(int *fd);

#endif //MY_CHANNEL_H
